package com.zzl.study.auth.domain;

import lombok.Getter;

/**
 * @author: zhangzl
 * @date: 2023/12/7 20:06
 * @version: 1.0
 * @description: 客户端设置
 * @see org.springframework.security.oauth2.server.authorization.settings.ClientSettings
 */
@Getter
public class ClientSettings {

    private static final String SETTINGS_NAMESPACE = "settings.";

    private static final String CLIENT_SETTINGS_NAMESPACE = SETTINGS_NAMESPACE.concat("client.");

    public static final String REQUIRE_PROOF_KEY = CLIENT_SETTINGS_NAMESPACE.concat("require-proof-key");

    public static final String REQUIRE_AUTHORIZATION_CONSENT = CLIENT_SETTINGS_NAMESPACE.concat("require-authorization-consent");

    /**
     * 是否需要Proof Key
     */
    private final boolean requireProofKey = false;

    /**
     * 是否要手动进行授权确认
     */
    private final boolean requireAuthorizationConsent = true;

    @Override
    public String toString() {
        return "{" +
                "\"@class\": \"java.util.Collections$UnmodifiableMap\"," +
                "\"" + REQUIRE_PROOF_KEY + "\": " + this.requireProofKey + "," +
                "\"" + REQUIRE_AUTHORIZATION_CONSENT + "\": " + this.requireAuthorizationConsent +
                "}";
    }

}
